package 
{
import flash.display.DisplayObject;
import mx.core.IUIComponent;
import mx.controls.DataGrid;

/** 
 *  DataGrid for PopUp Editor
 */
public class DataGridWithPopUpEditor extends DataGrid
{

	public function DataGridWithPopUpEditor()
	{
		super();
	}

	override public function contains(child:DisplayObject):Boolean
	{
		try
		{
	        while (child && child != this)
	        {
	            // do a parent walk
	            if (child is IUIComponent)
	                child = IUIComponent(child).owner;
	            else
	                child = child.parent;
	        }
		}
		catch (e:SecurityError)
		{
			// You can't own what you don't have access to.
			return false;
		}
		
        return child == this;
	}

}

}